package com.milling.web.controller;

import com.milling.business.service.SuspendTaskManager;
import com.milling.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/exapi")
public class SuspendController {
    @Autowired
    private SuspendTaskManager suspendTaskManager;

    @PostMapping("/suspend/resolve")
    public AjaxResult resolve(@RequestParam String token,
                              @RequestParam boolean confirm) {
        suspendTaskManager.resolveTask(token, confirm);
        return AjaxResult.success();
    }
}
